package com.lp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by lp
 * 2017/11/6 15:17
 */
@RestController
//@RequestMapping("/girl")
public class HelloController {

//    @Value("${cupSize}")
//    private String cupSize;
//
//    @Value("${age}")
//    private Integer age;
//    @Value("${content}")
//    private String content;
//
//    @RequestMapping(value = "hello", method = RequestMethod.GET)
//    public String say() {
//        //return "Hello Spring Boot!"+cupSize+age;
//        return content;
//    }

    @Autowired
    private GirlProperties girlProperties;

//    @RequestMapping(value = {"/hello","hi"}, method = RequestMethod.GET)
//    public String say() {
//        return girlProperties.getCupSize();
//        //return "index";
//    }

//    @RequestMapping(value = "/say/{id}", method = RequestMethod.GET)
//    public String say(@PathVariable("id") Integer id) {
//        return "id:"+id;
//    }

    @RequestMapping(value = "/say", method = RequestMethod.GET)
    public String say(@RequestParam(value="id",required = false,defaultValue = "10") Integer id) {
        return "id:"+id;
    }
}
